<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <title>The Apollo Awards</title>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

 <link rel="stylesheet" type="text/css" href="css/apollo.css" title="style"  media="screen"/>

<style type="text/css">
/*Rightside Dock*/
#rightsidebar #s_tooltip {
	 -moz-border-radius: 10px 10px 10px 10px;
    -moz-box-shadow: 1px #AAAAAA 1px 1px;
    background: none repeat scroll 0 0 #000000;
    color: #FFFFFF;
    display: none;
    font-size: 16px;
    font-weight: bold;
    padding-top: 4px;
    padding-left: 8px;
    position: absolute;
    default-space: nowrap;
} 
#rightsidebar { height: 202px; width: 50px; position: fixed; right: -1px; top: 50%; margin-top: -133px; z-index: 1000; }
#rightsidebar_1 { height: 250px; width: 33px; position: fixed; right: 120px; top: 50%; margin-top: -48px; z-index: 1000; }
#rightsidebar a { display: block; overflow: hidden; text-indent: -8793px; height: 67px; width: 50px; border: none; margin-bottom: 0px; margin-right: -17px}
#rightsidebar_1 a { display: block; overflow: hidden; text-indent: -8793px; height: 32px; width: 31px; border: none; margin-bottom: 0px; margin-right: -17px; position:absolute}
#rightsidebar_1 #facebook-icon { background: url('images/dock.png') repeat scroll 0px -209px transparent;}
#rightsidebar_1 #twitter-icon { background: url('images/dock.png') repeat scroll 0px -243px transparent; }
#rightsidebar_1 #delicious-icon { background: url('images/dock.png') repeat scroll 0px -277px transparent; }
#rightsidebar_1 #digg-icon { background: url('images/dock.png') repeat scroll 0px -311px transparent; }
#rightsidebar_1 #youtube-icon { background: url('images/dock.png') repeat scroll 0px -344px transparent; }
#rightsidebar_1 #stumble-icon { background: url('images/dock.png') repeat scroll 0px -378px transparent; }
#rightsidebar_1 #rss-icon { background: url('images/dock.png') repeat scroll 0px -412px transparent; }
#rightsidebar #arrange-icon { background: url('images/dock.png') repeat scroll 0px -2px  transparent; }
#rightsidebar #home-icon { background: url('images/dock.png') repeat scroll 0px -69px transparent;}
#rightsidebar #email-icon { background: url('images/dock.png') repeat scroll 0px -136px  transparent; }

</style>
<script type="text/javascript" src="js/apollo.js"></script>

</head>
<body >

<div id="container">

<div id="wrapper">
<!-- Top Navigation  -->
<div id="header">
	<a id="apollo_logo" href="#"><img src="images/apollo_logo_rough.png" width="170px" height="120px" /></a>
	<ul id="nav">
  		<li id="selected"><a href="#" >&nbsp;</a></li>
  		<li><a id="info_topmenu" href="#">Command Centre</a></li>
  		<li><a id="blog_topmenu" href="#">Communications Array</a></li>
  		<li><a id="media_topmenu" href="#">Press Corp</a></li>
  		<li><a id="about_topmenu" href="#">First Contact</a></li>
  		<li><a href="#" >&nbsp;</a></li>      
	</ul> 
</div>

<div id="space">
	<!-- Front Page  -->
	<ul id="apollo_system" >
		<li><a id="information_planet" class="tooltip" href="#" tooltip="HERICUS || INFORMATION Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam fermentum scelerisque urna, vitae pretium odio luctus quis. Aenean scelerisque diam eu enim feugiat laoreet. "><img src="images/planet_6.png" width="333px" height="333px" style="top:230px; left:20px;" /></a></li>
		<li><a id="blog_planet" class="tooltip" href="#" tooltip="ttttttttttttttttttttttttttttt"><img src="images/planet_5.png" width="133px" height="133px" style="top:10px; left:220px;" /></a></li>
		<li><a id="media_planet" class="tooltip" href="#" tooltip="kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"><img src="images/planet_4.png" width="233px" height="233px" style="top:200px; left:700px;" /></a></li>
		<li><a id="about_planet" class="tooltip" href="#" tooltip="ilghgjkhgkjjjjjjjjj"><img src="images/planet_1.png" width="80px" height="80px" style="top:30px; left:900px;" /></a></li>
	</ul>
	<!-- Planet Menu  --> 
	<div id = "orbit">  
			<div id="dock_info" class="dock_shelf"></div><div id="dock_media" class="dock_shelf"> </div><div id="dock_about" class="dock_shelf"></div>  
			<div id="orbit_center">
				<img id="center_planet_blog" src="images/planet_5.png" width="332px" height="332px"/>
			</div>
		<div id="x_axis">
   		<div id="y_axis">
   			<img id="center_planet" src="images/planet_6.png" width="332px" height="332px"/>
      		<div id="links">     	
      			<a id="moon1" onclick="$('#'+open_window[1]).mb_expand();" href="#e?x=250&y=-3"><img id="moon1_img" src="images/moon_2.png" style="position:absolute;top:-100px;left:-20px;width:3.5em;" /></a>
    	 		<a id="moon2" onclick="$('#'+open_window[2]).mb_expand();" href="#f?x=-150&y=-163"><img id="moon2_img" src="images/moon_1.png" style="position:absolute;top:-20px;left:-20px;width:3em;" /></a>
      			<a id="moon3" onclick="$('#'+open_window[3]).mb_expand();" href="#g?x=-180&y=223"><img id="moon3_img" src="images/moon_3.png" style="position:absolute;top:-20px;left:-20px;width:2.5em;" /></a>
      			<a id="moon4" onclick="$('#'+open_window[4]).mb_expand();" href="#g?x=-260&y=43"><img id="moon4_img"src="images/moon_4.png" style="position:absolute;top:-20px;left:-20px;width:1em;" /></a>
            </div>
  		</div> 
		</div>   
	</div>
</div>

<!-- Info Menu Windows -->
<div id="project_page" class="containerPlus draggable resizable window{buttons:'m,i', icon:'moon_6_icon.png', skin:'default', width:'800', height:'600',dock:'dock_info',iconized:'true', title:'Apollo Projects'}" style="position:fixed;top:150px;left:400px">  

	<div class="article_header">
		<h1><a href="#">Apollo Projects</a></h1>
		<p>Projects associated with apollo</p>
	</div>
    <div class="article_body">
    </div>
    <div class="article_footer">
    </div>
	  
</div>
		
<div id="awards_page" class="containerPlus draggable resizable window{buttons:'m,i', icon:'moon_3_icon.png', skin:'default', width:'800', height:'600',dock:'dock_info',iconized:'true', title:'The Apollo Awards'}" style="position:fixed;top:150px;left:400px">  

	<div class="article_header">
		<h1><a href="#">Apollo Awards</a></h1>
		<p>What is the Apollo Awards?</p>
	</div>
    <div class="article_body">
    </div>
    <div class="article_footer">
    </div>
	  
</div>

<!-- Blog Window-->
<div id="blog_console" class="containerPlus draggable window createwindow alone {buttons:'m', skin:'default', width:'340', height:'425', title:'&nbsp;&nbsp;&nbsp;Log', iconized:'false', closed:'true', alwaysOnTop:'true'}" style="position:fixed;top:127px;left:0px; ">

<?php

include "../site_specific/project.php";
include "../includes/constants.php";
include "../site_specific/external_constants.php";
include "../includes/phpmailer/class.phpmailer.php";
include "../includes/phpmailer/class.smtp.php";
include "../includes/utilities.php";
include "../includes/pages.php";
include "../includes/database.php";
include "../includes/users.php";
include "../includes/date.php";
include "../includes/files.php";
include "../includes/text.php";
include "../includes/tableproperties.php";
include "../includes/shopping_cart.php";
include "../includes/init_front.php";

echo "<div id=\"blog_wrap\">";
	
	  //echo "<div id=\"blog_tabs\" align=\"right\"> <span class=\"blog_tab\"><a id=\"dateSort\" href=\"#\">Refresh</a></span></div>";
	  
	  echo "<div class=\"pikachoose\">";
	  
		  echo "<ul id=\"pikame\">";
			  
			  echo "<li><a href=\"#\"><img src=\"images/circle.png\" ref=\"images/1.jpg\"></a><span><a href=\"#\">What to do when the Force fails</a></span></li>";
			  
			  echo "<li><a href=\"#\"><img src=\"images/circle.png\" ref=\"images/2.jpg\"></a><span><a href=\"#\">Klingon in 10 easy steps</a></span></li>";
			  
			  echo "<li><a href=\"#\"><img src=\"images/circle.png\" ref=\"images/3.jpg\"></a><span><a href=\"#\">Why Ewoks will rule the galaxy</a></span></li>";
			  
			  echo "<li><a href=\"#\"><img src=\"images/circle.png\" ref=\"images/4.jpg\"></a><span><a href=\"#\">How to make sure your TV show isn't pulled</a></span></li>";
		  
		  echo "</ul>";
		  
	  echo "</div>";
	  
	  echo "<div id=\"blog_list_wrap\">";
	  
	  	  echo "<ul id=\"blog_list\">";
		  
		  		//echo "<li class=\"blog_post\" id=\"selected1\" date=\"2\" tag=\"space\"><a href=\"#\" tooltip=\"hellllooooo  test kjnv  gb fh jdhj dfhj dh jdf jd hj dh jd hj dh j gh jd ghj dgh j ghj gfhj gh\" onclick=\"$('#blog_post_1').mb_open()\">How to tell if you're a Cylon</a></li>";

				//echo "<li class=\"blog_post\" date=\"3\" tag=\"dr who\"><a tooltip=\"TEST2 test kjnv  gb fh jdhj dfhj dh jdf jd hj dh jd hj dh j gh jd ghj dgh j ghj gfhj gh\" href=\"#\" onclick=\"$('#blog_post_2').mb_open()\">Why Daleks Make Great Pets</a></li>";
//
//				echo "<li class=\"blog_post\" date=\"1\" tag=\"space\"><a tooltip=\"Jellllooooo  test kjnv  gb fh jdhj dfhj dh jdf jd hj dh jd hj dh j gh jd ghj dgh j ghj gfhj gh\" href=\"#\" >The End of the Universe</a></li>";
//				echo "<li class=\"blog_post\" date=\"2\" tag=\"universe\"><a href=\"#\" >The End of the Universe</a></li>";

//				echo "<li class=\"blog_post\" date=\"1\" tag=\"dr who\"><a href=\"#\" >The End of the Universe</a></li>";

//				echo "<li class=\"blog_post\" date=\"1\" tag=\"universe\"><a href=\"#\" >The End of the Universe</a></li>";

		  
		  		$page_parent_id = "blog";

				$BlogList = $PAGES -> getChildrenOfPage($page_parent_id);
				
				$count = 0;
				
				foreach ($BlogList -> getPageIDs() as $nav_page_id) {
		
					# Get page details
					$nav_page = $BlogList-> getPage($nav_page_id);

					$blog_date = $nav_page -> getData("p_sort");
					
					$blog_tag = $nav_page -> getData("t_tag");
					
					$blog_tooltip = $nav_page -> getData("b_tooltip");
					
					$page_name = $nav_page -> getData("p_name");
					
					$tag_sql = "select t_tag FROM apollo_blogs b LEFT JOIN apollo_blogtag bt ON b.b_index = bt.bt_blog LEFT JOIN apollo_tags t ON t.t_index = bt.bt_tag WHERE b_id = \"".$nav_page_id."\"";
					
					//echo "tag_sql:".$tag_sql."<br/>";
						
					$tag_result = getRecord($tag_sql);
					
					$tag_list = "";
					
					$tag_count = 0;
					
					foreach($tag_result as $tag_key => $tag_value){
						
						if($tag_count == 0){

							$tag_list .= $tag_value["t_tag"];

						}
						else{
							$tag_list .= " ".$tag_value["t_tag"];

						}
						$tag_count++;
					}
					
					if($count==0){
	
						echo "<li class=\"blog_post\" id=\"selected1\" date=\"".$blog_date."\" tag=\"".$tag_list."\"><a tooltip=\"".$blog_tooltip."\" href=\"#\">".$page_name."</a></li>";
					}
					else{
						echo "<li class=\"blog_post\" date=\"".$blog_date."\" tag=\"".$tag_list."\"><a tooltip=\"".$blog_tooltip."\" href=\"#\">".$page_name."</a></li>";
					}
					
					$count ++;
					//echo "<li class=\"blog_post\" date=\"1\" tag=\"dr who\"><a tooltip=\"we4r5he4he4he4he45e45he4h5e45h4h\" href=\"#\" onclick=\"$('#".$nav_page_id."').mb_open()\">".$page_name."</a></li>";
					
					//echo "<li class=\"blog_post\" id=\"selected1\" date=\"2\" tag=\"space\"><a href=\"#\" tooltip=\"hellllooooo  test kjnv  gb fh jdhj dfhj dh jdf jd hj dh jd hj dh j gh jd ghj dgh j ghj gfhj gh\" onclick=\"$('#blog_post_1').mb_open()\">How to tell if you're a Cylon</a></li>";
				}
		 
		  echo "</ul>";
		  
	echo "</div>";
		  
	echo "<div id=\"blog_scroller\" align=\"center\">";
			
		echo "<a href=\"#\" onmouseover=\"scroll_down();\" onmouseout=\"stop_scroll();\">&#9660;</a>";
				
			echo "<span>&nbsp;&nbsp;&nbsp;</span>";
				
		echo "<a href=\"#\" onmouseover=\"scroll_up();\" onmouseout=\"stop_scroll();\" >&#9650;</a>";
		  
	echo "</div>";
	
echo "</div>";	

?>

</div>

<?php

foreach ($BlogList -> getPageIDs() as $nav_page_id) {
		
	# Get page details
	$nav_page = $BlogList-> getPage($nav_page_id);

	$blog_date = $nav_page -> getData("b_date");
	  
	$blog_tag = $nav_page -> getData("b_tag");
	  
	$blog_tooltip = $nav_page -> getData("b_tooltip");
	  
	$page_name = $nav_page -> getData("p_name");

	$page_url_content = $nav_page -> getData("p_content");
	
	$page_content = parseFlashLinks(parseFlashXML($page_url_content));
	
	echo "<div id=\"".$nav_page_id."\" class=\"containerPlus draggable resizable createwindow scroller blogpost{buttons:'f,m,c', icon:'moonov_03.png', skin:'default', width:'800', height:'600',iconized:'false', closed:'true', title:'Title 1'}\" style=\"position:fixed;top:50px;left:450px;\">";
	
	echo Remove_TP_Tag($page_content);
	
	echo "</div>";
}
  	  
?>


<!-- Image Gallery Window  -->
<div id="gallery_page" class="containerPlus draggable resizable window {buttons:'m,i', icon:'moon_2_icon.png', skin:'default', width:'800', height:'600', iconized:'true', dock:'dock_media', title:'Image Archives'}" style="position:fixed;top:150px;left:400px">
  
<?php

echo "<div id=\"viewport\">";

	echo "<div id=\"enclosure\">";		
	
		$page_parent_id = "image";

		$ImageList = $PAGES -> getChildrenOfPage($page_parent_id);

		echo "<div id=\"tiny-panel\">";
		
		for($i = 0;$i < 16; $i++){
			echo "<div class=\"slide-wrap\"></div>";
		}
		
		echo "</div>";
		
		echo "<div id=\"small-panel\">";
		
		for($i = 0;$i < 16; $i++){
			echo "<div class=\"slide-wrap\"></div>";
		}

		echo "</div>";
		
		echo "<div id=\"big-panel\">";
		
		$uploaded_files = getGallaryFiles(true, "");
		
		# Get files
		$current_data = array();
		foreach ($uploaded_files as $key => $file_group) {
			
			foreach ($file_group as $file_details) {
//				
//				$current_data[] = array("filename" => $file_details["name"],
//				
//					"type" => $FILE_TYPE_NAMES_ARRAY[$key],
//					
//					"size" => $file_details["size"]
				$image_url = "<img src=\"../front/gallery/".$file_details["name"]."\" width=\"100%\" height=\"100%\"/>";
				echo "<div class=\"slide-wrap\">".$image_url."</div>";

			}
			//print_r($file_group);
		}
		
		//print_r($current_data);

		//foreach ($ImageList -> getPageIDs() as $nav_page_id) {
//		
//			# Get page details
//			$nav_page = $ImageList-> getPage($nav_page_id);
//
//			$page_url_content = $nav_page  -> getData("p_content");	
//
//			$page_content = parseFlashLinks(parseFlashXML($page_url_content));
//	
//			echo "<div class=\"slide-wrap\">".Remove_TP_Tag($page_content)."</div>";
//		}

		echo "</div>";
	
	echo "</div>";

	echo "<div>";
	echo "<ul id=\"console\">";
	
		for($i=1;$i<=16;$i++){
			
			echo "<li><a href=\"#".$i."\"><img src=\"images/overlay.png\" width=\"35px\" height=\"35px\"/></a></li>";
		}
		
	echo "</ul>";
   echo "</div>";
echo "</div>";
?>

</div>
<!-- Image viewer Window  -->  
<div id="image_window" class="containerPlus draggable resizable window createwindow {buttons:'f,m,c', skin:'default', width:'850', height:'600', iconized:'false', closed:'true', title:'Image'}" style="position:fixed;top:100px;left:200px;">  

	<img id="#image" src="images/1.jpg" width="100%" height="100%" />
  
</div>  
<!-- Video embed window  -->
<div id="player_window" class="containerPlus draggable resizable window createwindow {buttons:'f,m,c', skin:'default', width:'800', height:'600', iconized:'false', closed:'true', title:'Video'}" style="position:fixed;top:200px;left:400px;">  

  
</div>  
<!-- Video Gallery Window -->
<div id="video_page" class="containerPlus draggable resizable window {buttons:'m,i', icon:'moon_4_icon.png', skin:'default', width:'400', height:'600', dock:'dock_media',iconized:'true', title:'Recordings'}" style="position:fixed;top:200px;left:200px">  

<?php

function getAndPrintUserUploads($userName)              
{     
  $yt = new Zend_Gdata_YouTube();
  $yt->setMajorProtocolVersion(2);
  printVideoFeed($yt->getuserUploads($userName));
}

function getUserFavorites($userName){
	
	$yt = new Zend_Gdata_YouTube();
	$yt->setMajorProtocolVersion(2);
	printVideoFeed($yt->getUserFavorites($userName));
}

function printVideoFeed($videoFeed)
{
  $count = 1;
  foreach ($videoFeed as $videoEntry) { 
    printVideoEntry1($videoEntry);
    $count++;
  }
}

function printVideoEntry1($videoEntry){
	
	$videoThumbnails = $videoEntry->getVideoThumbnails();

  	//foreach($videoThumbnails as $videoThumbnail) {
//	  echo $videoThumbnail['time'] . ' - ' . $videoThumbnail['url'];
//	  echo ' height=' . $videoThumbnail['height'];
//	  echo ' width=' . $videoThumbnail['width'] . "\n";
//  	}
	
	echo "<div class=\"float\">";
	
	//echo "<a href=\"#\" video=\"[".removeSubstring($videoEntry->getVideoWatchPageUrl())."]\"><img src=".$videoThumbnails[0]['url']." width=\"".$videoThumbnails[0]['width']."\" height=\"".$videoThumbnails[0]['height']."\"alt=\"\" /><br />";
	
	echo "<a video=\"[youtube=".$videoEntry->getVideoWatchPageUrl()."]\"><img src=".$videoThumbnails[0]['url']." width=\"".$videoThumbnails[0]['width']."\" height=\"".$videoThumbnails[0]['height']."\"alt=\"\" /><br />";
	
  	echo "<p>".$videoEntry->getVideoTitle()."</p>";
	
  	echo "</a>";
	echo "</div>";
}

//&feature=youtube_gdata_player
function removeSubstring($str){
	
	$str = str_replace('&feature=youtube_gdata_player','',$str);
	
	return $str;
}

require_once 'Zend/Loader.php'; // the Zend dir must be in your include_path
Zend_Loader::loadClass('Zend_Gdata_YouTube');
$yt = new Zend_Gdata_YouTube();

Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); 

echo getAndPrintUserUploads('theapolloawards');

echo getUserFavorites('theapolloawards');

//	$page_parent_id = "video";
//
//	$VideoList = $PAGES -> getChildrenOfPage($page_parent_id);
//
//	foreach ($VideoList -> getPageIDs() as $nav_page_id) {		
//			
//		  # Get page details
//		  $nav_page = $VideoList-> getPage($nav_page_id);
//
//		  $page_url_content = $nav_page  -> getData("p_content");	
//		  
//		  //echo "page_url_content:".$page_url_content."<br/>";
//
//		  $page_content = parseFlashLinks(parseFlashXML($page_url_content));
//		  
//		  echo "<div class=\"float\">";
//		  
//		  echo $page_content."<br/>";
//  
//		  echo "<p>".$nav_page  -> getData("p_id")."</p>";
//  
//		  echo "</a>";
//		  
//		  echo "</div>";
//	}




	
?>

</div>  

<div id="press_page" class="containerPlus draggable resizable window {buttons:'f,m,i', icon:'moon_1_icon.png', skin:'default', width:'800', height:'600',dock:'dock_media',iconized:'true', title:'Media Release'}" style="position:fixed;top:150px;left:400px"> 
<?php
	$page_parent_id = "article";

	$ArticleList = $PAGES -> getChildrenOfPage($page_parent_id);
	
	foreach ($ArticleList -> getPageIDs() as $nav_page_id) {		
			
		  # Get page details
		  $nav_page = $ArticleList-> getPage($nav_page_id);

		  $page_url_content = $nav_page  -> getData("p_content");	
		  
		  //echo "page_url_content:".$page_url_content."<br/>";

		  $page_content = parseFlashLinks(parseFlashXML($page_url_content));
		  
		  echo $page_content;
		  
	}

?>
</div>

<!-- About Menu Windows -->
<div id="contact_page" class="containerPlus draggable resizable window {buttons:'m,i', icon:'moon_1_icon.png', skin:'default', width:'800', height:'600',dock:'dock_about',iconized:'true', title:'The Team'}" style="position:fixed;top:150px;left:400px">  

	<div class="article_header">
		<h1><a href="#">The Team</a></h1>
		<p>People associated with apollo</p>
	</div>
    <div class="article_body">
    </div>
    <div class="article_footer">
    </div>	  
</div>
 
</div>
</div>

<div id="rightsidebar_1">
	<a id="facebook-icon" href="#" title="Share us on Facebook" >Share on Facebook</a>
	<a id="twitter-icon" href="#" title="Share us on Twitter" >Share on Twitter</a>
	<a id="delicious-icon"  href="#" title="Save on del.icio.us" >Save on del.icio.us</a>
	<a id="digg-icon" href="#" title="Digg us" >Digg us</a>
	<a id="youtube-icon" href="#" title="Get our RSS Feed" >Get our RSS Feed</a>
	<a id="stumble-icon" href="#" title="Stumble us">Stumble us</a>
	<a id="rss-icon" href="#" title="Get our RSS Feed">Get our RSS Feed</a>
</div>

<div id="rightsidebar">
	<a id="arrange-icon"  href="#" title="You click here to arrange your windows in multiple ways.">You click here to arrange your windows in multiple ways.</a>
	<a id="home-icon"  href="#" title="You click here to return to front page.">You click here to return to front page.</a>
	<a id="email-icon"  href="#" title="You click here to contact us.">You click here to contact us.</a>
</div>
</body>
</html>
